package team.yidong.fenda.wx.controller;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import team.yidong.fenda.service.GuahaoService;

/**
 * Created by xuanlong on 2018/3/17.
 */
@Controller
public class WxGuahaoController {
    @Autowired
    GuahaoService guahaoService;

    @RequestMapping("/wx/findGuahaoNum")
    @ResponseBody
    public JSONObject findGuahaoNum(@RequestParam Integer hospitalId, @RequestParam Integer hospitalDepartmentId) {
        return guahaoService.findGuahaoNum(hospitalId, hospitalDepartmentId);
    }

    @RequestMapping("/wx/findGuahaoMaster")
    @ResponseBody
    public JSONArray findGuahaoMaster(@RequestParam String guahaoDate, @RequestParam Integer hospitalId, @RequestParam Integer departmentId) {
        return guahaoService.findGuahaoMaster(guahaoDate, hospitalId, departmentId);
    }

    @RequestMapping("/wx/findMasterGuahaoNum")
    @ResponseBody
    public JSONObject findMasterGuahaoNum(@RequestParam Integer masterId, @RequestParam String guahaoDate) {
        return guahaoService.findMasterGuahaoNum(masterId, guahaoDate);
    }

    /*@RequestMapping("/wx/addGuahaoHistory")
    @ResponseBody
    public void addGuahaoHistory(@RequestParam Integer masterId,@RequestParam ) {
    }*/
}
